package homework;

import java.util.HashSet;

public class StudentManagement {
    public static void main(String[] args) {
        StudentManagement smt = new StudentManagement();
        smt.addStudent(new Student("110","张三","人工智能"));
        smt.addStudent(new Student("111","张三","人工智能"));
    }
    private HashSet<Student> s;
    public StudentManagement() {
        this.s = new HashSet<>();
    }
    //增加学生
    public void addStudent(Student e){
        boolean add = s.add(e);
        if(add){
            System.out.println("增加学生成功");
        }else{
            System.out.println("增加学生失败");
        }
    }
    //删除学生
    public void deleteStudent(Student e){
        boolean remove = s.remove(e);
        if(remove){
            System.out.println("删除成功");
        }else{
            System.out.println("删除失败");
        }
    }
}

